package com.sinosoft.ebusiness.domain.elementManage;
// 采用工具 Hibernate Tools 3.2.4.GA (sinosoft version) 生成，请勿手工修改。

import java.util.ArrayList;
import java.util.List;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinColumns;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.sinosoft.ebusiness.domain.elementManage.GeProduct;
import com.sinosoft.ebusiness.domain.elementManage.GeProductRiskId;
import com.sinosoft.ebusiness.domain.elementManage.GeRateCondition;


/**
 * POJO类GeProductRisk
 */
@Entity
@Table(name = "GE_PRODUCT_RISK")
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler"})
public class GeProductRisk implements java.io.Serializable {
	private static final long serialVersionUID = 1L;

	/** 属性ID */
	private GeProductRiskId id;

	/** 属性geProduct */
	private GeProduct geProduct;
	
	/**属性riskclass（新增）*/
	private String riskclass;

	/** 属性类型 */
	private String type;

	private String riskName;
	
	/** 属性geRateConditions */
	private List<GeRateCondition> geRateConditions = new ArrayList<GeRateCondition>(
			0);

	/**
	 * 类GeProductRisk的默认构造方法
	 */
	public GeProductRisk() {
	}

	/**
	 * 属性ID的getter方法
	 */
	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "productcode", column = @Column(name = "PRODUCTCODE")),
			@AttributeOverride(name = "riskCode", column = @Column(name = "RISKCODE")),
			@AttributeOverride(name = "version", column = @Column(name = "VERSION")) })
	public GeProductRiskId getId() {
		return this.id;
	}

	/**
	 * 属性ID的setter方法
	 */
	public void setId(GeProductRiskId id) {
		this.id = id;
	}
	
	/**
	 * 属性riskclass的getter方法
	 */

	@Column(name = "RISKCLASS")
	public String getRiskclass() {
		return this.riskclass;
	}

	public void setRiskclass(String riskclass) {
		this.riskclass = riskclass;
	}

	/**
	 * 属性geProduct的getter方法
	 */
	@JsonBackReference
	@JsonIgnore
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumns({
			@JoinColumn(name = "PRODUCTCODE", referencedColumnName = "PRODUCTCODE", nullable = false, insertable = false, updatable = false),
			@JoinColumn(name = "VERSION", referencedColumnName = "VERSION", nullable = false, insertable = false, updatable = false) })
	public GeProduct getGeProduct() {
		return this.geProduct;
	}

	/**
	 * 属性geProduct的setter方法
	 */
	public void setGeProduct(GeProduct geProduct) {
		this.geProduct = geProduct;
	}

	/**
	 * 属性类型的getter方法
	 */

	@Column(name = "TYPE")
	public String getType() {
		return this.type;
	}

	/**
	 * 属性类型的setter方法
	 */
	public void setType(String type) {
		this.type = type;
	}

	/**
	 * 属性geRateConditions的getter方法
	 */
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "geProductRisk")
	public List<GeRateCondition> getGeRateConditions() {
		return this.geRateConditions;
	}

	/**
	 * 属性geRateConditions的setter方法
	 */
	public void setGeRateConditions(List<GeRateCondition> geRateConditions) {
		this.geRateConditions = geRateConditions;
	}

	@Transient
	public String getRiskName() {
		return riskName;
	}

	public void setRiskName(String riskName) {
		this.riskName = riskName;
	}

	
}
